package model

import "time"

type OrderItem struct { //订单项目
	BaseModel
	AccountId      int32      `gorm:"type:int;index"`         //用户id
	OrderNo        string     `gorm:"type:varchar(64);index"` //订单编号
	PayType        string     `gorm:"type:varchar(16)"`       //支付类型
	Status         string     `gorm:"type:varchar(16)"`       //支付状态,这里做了冗余.直接将代码写明.
	TradeNo        string     `gorm:"type:varchar(64)"`       //为了双方对账.
	Addr           string     `gorm:"type:varchar(64)"`       //订单地址
	Receiver       string     `gorm:"type:varchar(16)"`       //接受人名字
	ReceiverMobile string     `gorm:"type:varchar(11)"`       //接收人电话
	PostCode       string     `gorm:"type:varchar(16)"`       //邮政编码
	OrderAmount    float32    `gorm:"type:double"`            //订单金额 这里注意切记不能用证书类型
	PayTime        *time.Time `gorm:"type:datetime"`          //购买时间
}

type OrderProduct struct {
	BaseModel
	OrderId     int32   `gorm:"type:int;index"`         //订单id
	ProductId   int32   `gorm:"type:int;index"`         //产品id
	ProductName string  `gorm:"type:varchar(64);index"` //产品名称
	CoverImage  string  `gorm:"type:varchar(128)"`      //产品链接
	RealPrice   float32 `gorm:"type:double"`            //真实成交价格
	Num         int32   `gorm:"type:int"`               //数量
}
